//
//  SXReadDetailListATableViewCell.m
//  ShiXun
//
//  Created by lanou on 15/10/28.
//  Copyright © 2015年 张琪. All rights reserved.
//

#import "SXReadDetailListATableViewCell.h"
#import "UIImageView+WebCache.h"
#import "UIView+UIView.h"

@implementation SXReadDetailListATableViewCell

+ (CGFloat)heightForCell
{
    return 235;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 5, kScreenWidth - 10, 30)];
        _titleLabel.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:_titleLabel];
        
        _bigImageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 40, 160 * 522 / 388, 160)];
        [self.contentView addSubview:_bigImageView];
        
        _litterOneImageView = [[UIImageView alloc] initWithFrame:CGRectMake(_bigImageView.width + 12, 40, kScreenWidth - _bigImageView.width - 22, 79)];
        [self.contentView addSubview:_litterOneImageView];
        
        _litterTwoImageView = [[UIImageView alloc] initWithFrame:CGRectMake(_litterOneImageView.x, 121, _litterOneImageView.width, 79)];
        [self.contentView addSubview:_litterTwoImageView];
        
        _sourceLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 210, kScreenWidth - 20, 15)];
        _sourceLabel.font = [UIFont systemFontOfSize:12];
        _sourceLabel.textColor = [UIColor colorWithWhite:0.344 alpha:1.000];
        [self.contentView addSubview:_sourceLabel];
    }
    return self;
}

- (void)setCongfigureModel:(SXReadModel *)congfigureModel
{
    _congfigureModel = congfigureModel;
    
    _titleLabel.text = congfigureModel.title;
    [_bigImageView sd_setImageWithURL:[NSURL URLWithString:congfigureModel.imgsrc] placeholderImage:[UIImage imageNamed:@"SX-placeholder"]];
    [_litterOneImageView sd_setImageWithURL:[NSURL URLWithString:congfigureModel.imgnewextraArr[0]] placeholderImage:[UIImage imageNamed:@"SX-placeholder"]];
    [_litterTwoImageView sd_setImageWithURL:[NSURL URLWithString:congfigureModel.imgnewextraArr[1]] placeholderImage:[UIImage imageNamed:@"SX-placeholder"]];
    _sourceLabel.text = congfigureModel.source;
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
